##################
# 全局配置及宏定义 #
##################

# 平台和.mk文件选择:
# ubuntu [plat].mk
# android [armeabi-v7a, arm64-v8a, mips64, x86, x86_64].mk
PLATFORM ?= ubuntu
include platform/$(PLATFORM)/plat.mk

# 基础路径
ROOT_PATH = $(shell pwd)
LIBS_PATH = $(ROOT_PATH)/libs
PKG_PATH = $(ROOT_PATH)/pkg

# 交叉编译器配置
# 在前面 plat-xxx.mk 中进行设置可以灵活覆盖掉以下配置
ARCH ?= $(shell uname -m)
GCC ?= $(CROSS)gcc
GXX ?= $(CROSS)g++
AR ?= $(CROSS)ar
AS ?= $(CROSS)as
NM ?= $(CROSS)nm
RANLIB ?= $(CROSS)ranlib
STRIP ?= $(CROSS)strip
OBJDUMP ?= $(CROSS)objdump
LD ?= $(CROSS)ld

# fe代码编译配置
FE_FLAGS += $(EXT_CFLAGS)
FE_INCS += $(EXT_INCS)
FE_LIBS += $(EXT_LIBS)

# 动态库编译模式
ifeq ($(BYSHARED),1)
FE_FLAGS += -lfethirdparty -Wall
# 静态库编译模式
else
FE_FLAGS += -lfreetype -liniparser -ljpeg -lpng -lz -static -Wall
endif

ifeq ($(ARCH),aarch64)
FE_FLAGS += -pthread -lm -lstdc++
else
FE_FLAGS += -lpthread -lm -lstdc++
endif
